package models

//情感原力
//情感原力决定着与对象之间的关系值
//情感的变化遵循着物极必反的原力，情绪总是在【-10，10】之间周二反复
type PrimitiveEmotion struct {
	Tan int //贪
	Chen int //嗔
	Chi int //痴
	Heng int //恨
	Ai int //爱
	Wu int //恶
	Yu int //欲
}

//想象人的情况就是一面平静的水面，人与人交际就是向他的内心投一块石头，石头激起涟漪，如同激起了心中的七情六欲，不同的情欲都会
//产出不同的变化

//增加爱
func (this *PrimitiveEmotion) AddTan(value int) int {
	tmp := this.Tan + value
	for tmp < -10 || tmp > 10 {
		if tmp < 0 {
			tmp += 10
		} else {
			tmp -= 10
		}
	}
	this.Tan = tmp

	return tmp
}

//增加爱
func (this *PrimitiveEmotion) AddChen(value int) int {
	tmp := this.Chen + value
	for tmp < -10 || tmp > 10 {
		if tmp < 0 {
			tmp += 10
		} else {
			tmp -= 10
		}
	}
	this.Chen = tmp

	return tmp
}

//增加爱
func (this *PrimitiveEmotion) AddChi(value int) int {
	tmp := this.Chi + value
	for tmp < -10 || tmp > 10 {
		if tmp < 0 {
			tmp += 10
		} else {
			tmp -= 10
		}
	}
	this.Chi = tmp

	return tmp
}

//增加爱
func (this *PrimitiveEmotion) AddHeng(value int) int {
	tmp := this.Heng + value
	for tmp < -10 || tmp > 10 {
		if tmp < 0 {
			tmp += 10
		} else {
			tmp -= 10
		}
	}
	this.Heng = tmp

	return tmp
}

//增加爱
func (this *PrimitiveEmotion) AddAi(value int) int {
	tmp := this.Ai + value
	for tmp < -10 || tmp > 10 {
		if tmp < 0 {
			tmp += 10
		} else {
			tmp -= 10
		}
	}
	this.Ai = tmp

	return tmp
}

//增加爱
func (this *PrimitiveEmotion) AddWu(value int) int {
	tmp := this.Wu + value
	for tmp < -10 || tmp > 10 {
		if tmp < 0 {
			tmp += 10
		} else {
			tmp -= 10
		}
	}
	this.Wu = tmp

	return tmp
}

//增加爱
func (this *PrimitiveEmotion) AddYu(value int) int {
	tmp := this.Yu + value
	for tmp < -10 || tmp > 10 {
		if tmp < 0 {
			tmp += 10
		} else {
			tmp -= 10
		}
	}
	this.Yu = tmp

	return tmp
}

//获取当前情感原力状态值
func (this *PrimitiveEmotion) GetState() {

}